<template>
  <div id="app">
    <div class="container">
      <!-- 默认是模糊匹配, exact 启用严格匹配模式 -->
      <router-link class="link" to="/" tag="div" exact>首页1</router-link>
      <router-link class="link" to="/home" tag="div">首页2</router-link>
      <router-link class="link" to="/news" tag="div">新闻</router-link>
      <router-link class="link" to="/user" tag="div">用户</router-link>
    </div>
    <router-view></router-view>
    <router-view name="aside"></router-view>
  </div>
</template>

<script>

export default {
  name: 'App',
  components: {
  }
}
</script>

<style>
.container {
  display: flex;
}
.link {
  width: 100px;
  height: 50px;
  line-height: 50px;
  text-align: center;
  font-size: 20px;
  border: 1px solid #000;
  cursor: pointer;
}
.active {
  background-color: gold;
}
</style>
